{# Twig
// This file should be in UTF8 without BOM - Accents examples: éèê
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2015 Advisto SAS, service PEEL - contact@peel.fr  |
// +----------------------------------------------------------------------+
// | This file is part of PEEL Shopping 7.2.1, which is subject to an	  |
// | opensource GPL license: you are allowed to customize the code		  |
// | for your own needs, but must keep your changes under GPL			  |
// | More information: https://www.peel.fr/lire/licence-gpl-70.html		  |
// +----------------------------------------------------------------------+
// | Author: Advisto SAS, RCS 479 205 452, France, https://www.peel.fr/	  |
// +----------------------------------------------------------------------+
// $Id: recursive_items_display.tpl 44077 2015-02-17 10:20:38Z sdelaporte $
#}{% for it in items %}
		{% set max_length=it.item_max_length %}
		{% if (it.nb) %}
		{% set max_length=max_length-(it.nb|length)-3 %}
		{% endif %}
		{% if it.has_sons and location == 'left' %}
		{% set max_length=max_length-3 %}
		{% endif %}
	{% if display_mode=='option' %}
<option value="{{ it.value|str_form_value }}"{% if it.is_selected %} selected="selected" class="bold"{% endif %}>{{ it.indent }}{{ it.name|str_shorten(max_length) }}</option>{% if it.has_sons and (it.SONS) %}{{ it.SONS }}{% endif %}
	{% elseif display_mode=='checkbox' %}
<div class="col-md-4"><input name="{{ input_name|str_form_value }}[]" type="checkbox" value="{{ it.value|str_form_value }}"{% if it.is_selected %} checked="checked" class="bold"{% endif %} />{{ it.name|str_shorten(max_length) }}</div>{% if it.has_sons and (it.SONS) %}{{ it.SONS }}{% endif %}
	{% else %}
<li class="{% if it.has_sons %}dropdown-submenu plus{% else %}minus{% endif %}{% if it.is_current %} current{% endif %}{% if (it.technical_code) %} m_item_{{ it.technical_code }}{% endif %}">
	{% if it.has_sons and (it.SONS) %}
		 {{ it.indent }}<a id="{{ it.id }}" class="dropdown-toggle" href="{{ it.href }}">{% if (it.nb) %}<span class="nb_item badge pull-right">{{ it.nb }}</span> {% endif %}{{ it.name|str_shorten(max_length) }}</a>
		<ul class="sousMenu level{{ it.depth }}" dropdown-menu" aria-labelledby="{{ it.id }}" role="menu">{{ it.SONS }}</ul>
	{% elseif (it.href) %}
		 {{ it.indent }}<a href="{{ it.href|escape('html') }}">
			{% if it.has_sons and location == 'left' %}
				<span class="menu_categorie_link">{% if (it.nb) %} <span class="nb_item badge pull-right">{{ it.nb }}</span> {% endif %}{{ it.name|str_shorten(max_length) }}</span><span class="glyphicon glyphicon-chevron-right" title="+"></span>
			{% else %}
				{% if (it.nb) %} <span class="nb_item badge pull-right">{{ it.nb }}</span> {% endif %}{{ it.name|str_shorten(max_length) }}
			{% endif %}
		</a>
	{% endif %}
</li>
	{% endif %}
{% endfor %}